<template>
  <div class="home">
    <HelloWorld @showParentComp="clickFn" msg="我是父级"/>
    <p>从子级传过来的值是：{{chrData}}</p>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'

export default {
  name: 'home',
  components: {
    HelloWorld
  },
  data () {
    return {
      chrData: ''
    }
  },
  methods: {
    clickFn: function (e) {
      console.log(e)
      this.chrData = e
    }
  }
}
</script>
<style lang="stylus">
.home
  width: 100%
</style>
